import http from "../utils/http";

// 新增收获地址
export const reqAddressAdd = (addressData) => {
  return http.request({
    url: "/userAddress/save",
    method: "POST",
    data: addressData,
  });
};

// 收获地址列表
export const reqAddressList = () => {
  return http.request({
    url: "/userAddress/findUserAddress",
    method: "GET",
  });
};

// 收货地址详情
export const reqAddressInfo = (id) => {
  return http.request({
    url: `/userAddress/${id}`,
    method: "GET",
  });
};

// 更新收获地址
export const reqAddressUpload = (addressData) => {
  return http.request({
    url: "/userAddress/update",
    method: "POST",
    data: addressData,
  });
};

// 删除收获地址
export const reqAddressDel = (id) => {
  return http.request({
    url: `/userAddress/delete/${id}`,
    method: "GET",
  });
};
